package cn.com.twoke.application.game.mario.game.entity;

import cn.com.twoke.application.game.mario.core.ecs.world.GameWorld;
import cn.com.twoke.application.game.mario.core.ecs.entity.Entity;
import cn.com.twoke.application.game.mario.game.entity.enemy.EnemyBuilder;
import cn.com.twoke.application.game.mario.game.entity.enemy.EnemyManager;
import cn.com.twoke.application.game.mario.game.entity.enemy.EnemyManagerImpl;

public class EntityBuilderFactory {

    private final GameWorld world;

    public EntityBuilderFactory(GameWorld world) {
        this.world = world;
    }

    public Entity createEntity() {
        return this.world.createEntity();
    }

    /**
     * 普通快构建者
     * @return
     */
    public BlockBuilder block() {
        return new BlockBuilder(this.world);
    }

    /**
     * 管道构建者
     * @return
     */
    public PipeBuilder pipe() {
        return new PipeBuilder(this.world);
    }

    /**
     * 玩家构建者
     * @return
     */
    public PlayerBuilder player() {
        return new PlayerBuilder(this.world);
    }

    /**
     * 传送门构建者
     * @return
     */
    public TransferBuilder transfer() {
        return new TransferBuilder(this.world);
    }


    private EnemyManager enemyManager = new EnemyManagerImpl();
    public EnemyBuilder enemy() {
        return new EnemyBuilder(this.world, this.enemyManager);
    }
}
